﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/common.jsp"%>
<html>
	<head>	
		<title>风险点辨析库记录</title>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script type="text/javascript" src="<%=contextPath%>/js/validator.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/jquery.autogrow.js"></script> 
		<script type="text/javascript">
			$(document).ready (function() {
		
			$('textarea').autogrow();		
			});		
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				       {
				            text: '保存',
				            icon:"<%=contextPath%>/images/save.gif",
							 hidden:<%=session.getAttribute("btn_add_display") != null || "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>,	
				            handler:function(){
				            	comt();
				            }
				        },'-',
				        {
				            text: '返回',
				            icon:"<%=contextPath%>/images/fanhui.png",
				            handler:function(){
				            	back();
				            }
				        }
			    	]
			    });
			});
			
			function print(){
			if(document.getElementById("entity.id").value == "0") {
		 	    alert("请先保存风险点辨析库");
		 		return false;
		 	}			
			var url="<%=contextPath%>/cllyjl!initZbtzDetail.do?directFlag=PRINT_SUCCESS&id=${entity.id}";
			 var win = openSUB(url,2,800,600,50,30);
			}
			function getprojectinfo(){
			window.open("<%=contextPath%>/projectImplement!findByUnitno.do", '统计表格', 'height=800, width=350, top=200, left=300, toolbar=no, menubar=no');
			// document.frmM.action = "<%=contextPath%>/projectImplement!findByUnitno";
			}
			
		</script>
	</head>
  
  <body topmargin="0" >
	<div id = "tbar" style="position:absolute;display:block left:0px; top:0px; width:100%; height:35px; z-index:1;"></div>
	<br>
	<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
	
		<!-- 信息提示 -->
		<div id="result" align="center"><font color="red">${info }</font></div>
		<table width="100%" height="30">
			<tr>
				<td colspan="4" align="center">
					<span  style="font: 22pt/22pt 宋体;"><strong><b>风险点辨析库</b></strong></span>
				</td>
			</tr>
		</table>
 		<form id="frmM" class="ct" name="frmM" method="POST" action="<%=contextPath%>/zbtz!saveZbtz.do">
		<input type="hidden" name="searchBean.con6" id="searchBean.con6" value="${searchBean.con6}" >
 			<s:hidden name="entity.dantype" />	
			<input type="hidden" name="entity.id" id="entity_id" value="${entity.id}"/>
			<s:hidden name="entity.bdz"/>
			<input type="hidden" name="id"  value="${id}"/>
			<table width="100%" border="0" id="infotab">
			<tr>
					
					<th width="120" >
						<font color="red"></font>&nbsp;变电站：
					</th>
					<td nowrap>
					<input type="text" readonly="true" style="width:50%"  name="entity.bdzname" value="${entity.bdzname}" msg="变电站必须输入。"/>
					<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="选择变电站" onClick="javascript:getBdzjx('entity.bdz','entity.bdzname','entity.ouid')" />
					
					</td>
					<th width="120" nowrap>
						<font color="red"></font>&nbsp;设备名称：
					</th>
					<td colspan="1">
						<input type="text"  style="width:80%" readonly="true"  name="entity.sbmc" value="${entity.sbmc}" msg="设备名称必须输入。" />
						<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getSB('')" />
						</td>
					
				</tr>
				<tr>
					<th width="120" nowrap>
						<font color="red"></font>&nbsp;电压等级：
					</th>
					<td>
					<input type="text"  readonly="true"  name="entity.dydj" value="${entity.dydj}" msg="电压等级必须输入。" />
					</td>
					<th width="120" nowrap>
						<font color="red"></font>&nbsp;设备类别：
					</th>
					<td>
						<s:select list="sblxList" emptyOption="true"  name="entity.sblx" width="300" listKey="itemId" listValue="itemName" msg="设备类别必须输入。"/>
					</td>
						
				</tr>
				<tr>
					<th align="left" >设备型号： </th>  
					<td colspan="3" >
						<textarea name="entity.sbxh" style="width:99%; height: 30px; min-height: 20px;line-height:15pt" min="0" datatype="LimitB"  min="0"   max="200"   maxlength="50" size="25"  >${entity.sbxh}</textarea></td>
				</tr>
				<tr>
					<th align="left" ><font color="red">*</font>作业内容： </th>  
					<td colspan="2" style="width:90%">
						<textarea name="entity.zynr" readonly="true" datatype="Require" style="width:99%; height: 30px; min-height: 20px;line-height:15pt" min="0" datatype="LimitB"   max="200"   maxlength="50"   msg="作业内容必须输入。">${entity.zynr}</textarea>
						</td>
						<td >
						<img src="<%=contextPath%>/images/editlink.gif" onclick = "getZymc()" style="cursor:pointer"/>
						</td>
				</tr>
				<tr>
					<th align="left" ><font color="red">*</font>风险点： </th>  
					<td colspan="3" >
						<textarea name="entity.fxd" datatype="Require" style="width:99%; height: 30px; min-height: 20px;line-height:15pt" min="0" datatype="LimitB"  min="0"   max="200"   maxlength="50" size="25"  msg="风险点必须输入。">${entity.fxd}</textarea></td>
				</tr>
				<tr>
					<th align="left" ><font color="red">*</font>控制措施： </th>  
					<td colspan="3" >
						<textarea name="entity.kzcs" datatype="Require" style="width:99%; height: 30px; min-height: 20px;line-height:15pt" min="0" datatype="LimitB"  min="0"   max="200"   maxlength="50" size="25"  msg="控制措施必须输入。">${entity.kzcs}</textarea></td>
				</tr>
				<tr>
					<th align="left" >备注： </th>  
					<td colspan="3" >
						<textarea name="entity.bz" style="width:99%; height: 30px; min-height: 20px;line-height:15pt" min="0" datatype="LimitB"  min="0"   max="200"   maxlength="50" size="25"  >${entity.bz}</textarea></td>
				</tr>
				<% if ("0".equals(session.getAttribute("SESSION_ISADMIN"))) {%>
				<tr>
					<th width="120" nowrap>
						录入人员：
					</th>
					<td>
						<s:hidden name="entity.cjrid"/>
						<input type="text" style="width:120" readonly="true" name="entity.cjr" value="${entity.cjr}" msg="录入人员必须输入。"/>
					</td>
					<th width="120" nowrap>
						录入时间：
					</th>
					<td>
						<input type="text" size="12" name="entity.cjsj" readonly="true" value='<fmt:formatDate value="${entity.cjsj}" pattern="yyyy-MM-dd HH:mm"/>' msg="巡视结束时间必须输入。"/>
					</td>
					
				</tr>
				<%} else {%>
				<tr>
					<th width="120" nowrap>
						录入人员：
					</th>
					<td>
						<s:hidden name="entity.cjrid"/>
						<input type="text" style="width:120" readonly="true" name="entity.cjr" value="${entity.cjr}" msg="录入人员必须输入。"/>
						<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getUser('entity.cjrid','entity.cjr')" />
					</td>
					<th width="120" nowrap>
						录入时间：
					</th>
					<td>
						<input type="text" size="12" onclick="WdatePicker({el:$dp.$('entity.cjsj')})" name="entity.cjsj" readonly="true" value='<fmt:formatDate value="${entity.cjsj}" pattern="yyyy-MM-dd HH:mm"/>' msg="巡视结束时间必须输入。"/>
						<img onclick="WdatePicker({el:$dp.$('entity.cjsj')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
					
				</tr>
				<%}%>
			</table>				
   </form>
   </div>
  </body>
</html>
<script language="javascript">
	
		//删除一行（已有数据）
		function delrow(row,id){
	 
	// window.alert(id);
			if (confirm("确定要删除该条记录吗？")) {
				if(id != 0) {
					Ext.Ajax.request({
						method :'POST',
						url :'aqgl!deleteDetail.do?id=' + id,
						params : {},
						success : function(response, options) {
							var obj = Ext.decode(response.responseText);
							Ext.MessageBox.alert('提示', obj["msg"]);
						
		   					$(row).parents(".repeat").remove();	
	 
						},
						failure : function(response, options) {
							Ext.MessageBox.alert('提示 ', '删除失败。');
						}
					});
				} else {
					$(row).parents(".repeat").remove();	
				}
	 
			}
	 
		} 		
	 // 保存
     function comt(){
        setEndCheck();
        if(!Validator.Validate(frmM,1)){
			return false;
		}
     	document.frmM.action = "<%=contextPath%>/aqgl!saveAqgl.do?directFlag=NEW_SUCCESS";
     	document.frmM.submit();
     }
     
     // 返回
     function back() {
        /**window.parent.window.location.href = "<%=contextPath%>/jsp/business/zbtz/listTabBase.jsp?url=zbtzList!getList.do&searchBean.con20=1&searchBean.con6=1&countPerPage=28&m=m&qxbtn=0";*/
		document.frmM.action = "<%=contextPath%>/aqglList!getList.do";
		document.frmM.submit();
     }
 // 获得设备
	function getSB(bdzid) {
	    bdzid=document.getElementById("entity.bdz").value;
		var url = "/DLPLANMIS/jsp/business/zbtz/selectSB.jsp?bdzid="+bdzid;
		var win = openSUB(url,2,300,520,450,30);
	}
	// 获得标准工时库作业内容
	function getZymc() {
	    bdzid=document.getElementById("entity.bdz").value;
		var url = "/DLPLANMIS/jsp/business/zbtz/bzgsk.jsp?bdzid="+bdzid;
		//var win = openSUB(url,2,300,520,450,30);
		 var win = window.open(url,"标准工时库作业内容列表","left=150,top=30,width=1000,height=600,status=no,toolbar=no,autoscroll=yes,location=no,menubar=no,resizable=yes",true);
	
	}
	// 保存时变电站,电压等级,设备类别,设备型号,设备名称必须选择一列验证 by wangtao add20130508
		function setEndCheck() {
			if (document.getElementById("entity.bdzname").value==''&&document.getElementById("entity.sbmc").value==''&&document.getElementById("entity.dydj").value==''&&document.getElementById("entity.sbxh").value==''&&document.getElementById("entity.sblx").value=='') {
					window.alert("变电站,电压等级,设备类别,设备型号,设备名称必须选择一项输入");
					return false;
		    }
		}
</script>
